//
//  ServerCell.m
//  YoucApp
//
//  Created by Liam on 11/15/12.
//
//

#import "ServerCell.h"

@implementation ServerCell

@synthesize serverName = _serverName;
@synthesize platformUrl = _platformUrl;
@synthesize platformName = _platformName;
@synthesize serverTime = _serverTime;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
	self = [super initWithCoder:aDecoder];
	if (self) {
		// Initialization code.
		self.contentView.backgroundColor = self.backgroundColor;
	}
	return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc {
    [_serverName release];
    [_platformUrl release];
    [_platformName release];
    [_serverTime release];
    [super dealloc];
}

- (void)prepareForReuse
{
    [super prepareForReuse];
}

- (void)setServerTimeInterval:(NSTimeInterval)timeInterval
{
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timeInterval];
    NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
    [formatter setDateFormat:@"MM.dd HH:mm"];
    self.serverTime.text = [formatter stringFromDate:date];
}

@end
